| Conditions | 7 |
| Total Lines | 23 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | /** global: aesCrypt */ |
||
| 25 | function appendBytes(input) { |
||
| 26 | let tmp = []; |
||
| 27 | |||
| 28 | if (typeof (input) == "number") { |
||
| 29 | let hex = input.toString(16); |
||
| 30 | tmp = hex.match(/.{1,2}/g).map((byte) => parseInt(byte, 16)); |
||
| 31 | } else if (typeof (input) == "string") { |
||
| 32 | for (let i = 0; i < input.length; i ++) { |
||
| 33 | tmp.push(input.charCodeAt(i)); |
||
| 34 | } |
||
| 35 | } else { |
||
| 36 | tmp = input; |
||
| 37 | } |
||
| 38 | |||
| 39 | tmp = new Uint8Array(tmp); |
||
| 40 | |||
| 41 | let tmpArr = new Uint8Array(_data.length + tmp.length); |
||
| 42 | |||
| 43 | tmpArr.set(_data); |
||
| 44 | tmpArr.set(tmp, _data.length); |
||
| 45 | |||
| 46 | _data = tmpArr; |
||
| 47 | } |
||
| 48 | |||
| 63 | }()); |